home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / docs / gas / as.i3 < prev    next >
Encoding:
GNU Info File  |  1994-12-17  |  46.3 KB  |  1,432 lines

  1. This is Info file as.info, produced by Makeinfo-1.55 from the input
  2. file ./as.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * As: (as).                     The GNU assembler.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents the GNU Assembler "as".
  9.  
  10.    Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  11.  
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.  
  16.    Permission is granted to copy and distribute modified versions of
  17. this manual under the conditions for verbatim copying, provided that
  18. the entire resulting derived work is distributed under the terms of a
  19. permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions.
  24.  
  25. 
  26. File: as.info,  Node: VAX-directives,  Next: VAX-opcodes,  Prev: VAX-float,  Up: Vax-Dependent
  27.  
  28. Vax Machine Directives
  29. ----------------------
  30.  
  31.    The Vax version of the assembler supports four directives for
  32. generating Vax floating point constants.  They are described in the
  33. table below.
  34.  
  35. `.dfloat'
  36.      This expects zero or more flonums, separated by commas, and
  37.      assembles Vax `d' format 64-bit floating point constants.
  38.  
  39. `.ffloat'
  40.      This expects zero or more flonums, separated by commas, and
  41.      assembles Vax `f' format 32-bit floating point constants.
  42.  
  43. `.gfloat'
  44.      This expects zero or more flonums, separated by commas, and
  45.      assembles Vax `g' format 64-bit floating point constants.
  46.  
  47. `.hfloat'
  48.      This expects zero or more flonums, separated by commas, and
  49.      assembles Vax `h' format 128-bit floating point constants.
  50.  
  51. 
  52. File: as.info,  Node: VAX-opcodes,  Next: VAX-branch,  Prev: VAX-directives,  Up: Vax-Dependent
  53.  
  54. VAX Opcodes
  55. -----------
  56.  
  57.    All DEC mnemonics are supported.  Beware that `case...' instructions
  58. have exactly 3 operands.  The dispatch table that follows the `case...'
  59. instruction should be made with `.word' statements.  This is compatible
  60. with all unix assemblers we know of.
  61.  
  62. 
  63. File: as.info,  Node: VAX-branch,  Next: VAX-operands,  Prev: VAX-opcodes,  Up: Vax-Dependent
  64.  
  65. VAX Branch Improvement
  66. ----------------------
  67.  
  68.    Certain pseudo opcodes are permitted.  They are for branch
  69. instructions.  They expand to the shortest branch instruction that
  70. reaches the target.  Generally these mnemonics are made by substituting
  71. `j' for `b' at the start of a DEC mnemonic.  This feature is included
  72. both for compatibility and to help compilers.  If you do not need this
  73. feature, avoid these opcodes.  Here are the mnemonics, and the code
  74. they can expand into.
  75.  
  76. `jbsb'
  77.      `Jsb' is already an instruction mnemonic, so we chose `jbsb'.
  78.     (byte displacement)
  79.           `bsbb ...'
  80.  
  81.     (word displacement)
  82.           `bsbw ...'
  83.  
  84.     (long displacement)
  85.           `jsb ...'
  86.  
  87. `jbr'
  88. `jr'
  89.      Unconditional branch.
  90.     (byte displacement)
  91.           `brb ...'
  92.  
  93.     (word displacement)
  94.           `brw ...'
  95.  
  96.     (long displacement)
  97.           `jmp ...'
  98.  
  99. `jCOND'
  100.      COND may be any one of the conditional branches `neq', `nequ',
  101.      `eql', `eqlu', `gtr', `geq', `lss', `gtru', `lequ', `vc', `vs',
  102.      `gequ', `cc', `lssu', `cs'.  COND may also be one of the bit tests
  103.      `bs', `bc', `bss', `bcs', `bsc', `bcc', `bssi', `bcci', `lbs',
  104.      `lbc'.  NOTCOND is the opposite condition to COND.
  105.     (byte displacement)
  106.           `bCOND ...'
  107.  
  108.     (word displacement)
  109.           `bNOTCOND foo ; brw ... ; foo:'
  110.  
  111.     (long displacement)
  112.           `bNOTCOND foo ; jmp ... ; foo:'
  113.  
  114. `jacbX'
  115.      X may be one of `b d f g h l w'.
  116.     (word displacement)
  117.           `OPCODE ...'
  118.  
  119.     (long displacement)
  120.                OPCODE ..., foo ;
  121.                brb bar ;
  122.                foo: jmp ... ;
  123.                bar:
  124.  
  125. `jaobYYY'
  126.      YYY may be one of `lss leq'.
  127.  
  128. `jsobZZZ'
  129.      ZZZ may be one of `geq gtr'.
  130.     (byte displacement)
  131.           `OPCODE ...'
  132.  
  133.     (word displacement)
  134.                OPCODE ..., foo ;
  135.                brb bar ;
  136.                foo: brw DESTINATION ;
  137.                bar:
  138.  
  139.     (long displacement)
  140.                OPCODE ..., foo ;
  141.                brb bar ;
  142.                foo: jmp DESTINATION ;
  143.                bar:
  144.  
  145. `aobleq'
  146. `aoblss'
  147. `sobgeq'
  148. `sobgtr'
  149.     (byte displacement)
  150.           `OPCODE ...'
  151.  
  152.     (word displacement)
  153.                OPCODE ..., foo ;
  154.                brb bar ;
  155.                foo: brw DESTINATION ;
  156.                bar:
  157.  
  158.     (long displacement)
  159.                OPCODE ..., foo ;
  160.                brb bar ;
  161.                foo: jmp DESTINATION ;
  162.                bar:
  163.  
  164. 
  165. File: as.info,  Node: VAX-operands,  Next: VAX-no,  Prev: VAX-branch,  Up: Vax-Dependent
  166.  
  167. VAX Operands
  168. ------------
  169.  
  170.    The immediate character is `$' for Unix compatibility, not `#' as
  171. DEC writes it.
  172.  
  173.    The indirect character is `*' for Unix compatibility, not `@' as DEC
  174. writes it.
  175.  
  176.    The displacement sizing character is ``' (an accent grave) for Unix
  177. compatibility, not `^' as DEC writes it.  The letter preceding ``' may
  178. have either case.  `G' is not understood, but all other letters (`b i l
  179. s w') are understood.
  180.  
  181.    Register names understood are `r0 r1 r2 ... r15 ap fp sp pc'.  Upper
  182. and lower case letters are equivalent.
  183.  
  184.    For instance
  185.      tstb *w`$4(r5)
  186.  
  187.    Any expression is permitted in an operand.  Operands are comma
  188. separated.
  189.  
  190. 
  191. File: as.info,  Node: VAX-no,  Prev: VAX-operands,  Up: Vax-Dependent
  192.  
  193. Not Supported on VAX
  194. --------------------
  195.  
  196.    Vax bit fields can not be assembled with `as'.  Someone can add the
  197. required code if they really need it.
  198.  
  199. 
  200. File: as.info,  Node: AMD29K-Dependent,  Next: H8/300-Dependent,  Prev: Vax-Dependent,  Up: Machine Dependencies
  201.  
  202. AMD 29K Dependent Features
  203. ==========================
  204.  
  205. * Menu:
  206.  
  207. * AMD29K Options::              Options
  208. * AMD29K Syntax::               Syntax
  209. * AMD29K Floating Point::       Floating Point
  210. * AMD29K Directives::           AMD 29K Machine Directives
  211. * AMD29K Opcodes::              Opcodes
  212.  
  213. 
  214. File: as.info,  Node: AMD29K Options,  Next: AMD29K Syntax,  Up: AMD29K-Dependent
  215.  
  216. Options
  217. -------
  218.  
  219.    `as' has no additional command-line options for the AMD 29K family.
  220.  
  221. 
  222. File: as.info,  Node: AMD29K Syntax,  Next: AMD29K Floating Point,  Prev: AMD29K Options,  Up: AMD29K-Dependent
  223.  
  224. Syntax
  225. ------
  226.  
  227. * Menu:
  228.  
  229. * AMD29K-Chars::                Special Characters
  230. * AMD29K-Regs::                 Register Names
  231.  
  232. 
  233. File: as.info,  Node: AMD29K-Chars,  Next: AMD29K-Regs,  Up: AMD29K Syntax
  234.  
  235. Special Characters
  236. ..................
  237.  
  238.    `;' is the line comment character.
  239.  
  240.    `@' can be used instead of a newline to separate statements.
  241.  
  242.    The character `?' is permitted in identifiers (but may not begin an
  243. identifier).
  244.  
  245. 
  246. File: as.info,  Node: AMD29K-Regs,  Prev: AMD29K-Chars,  Up: AMD29K Syntax
  247.  
  248. Register Names
  249. ..............
  250.  
  251.    General-purpose registers are represented by predefined symbols of
  252. the form `GRNNN' (for global registers) or `LRNNN' (for local
  253. registers), where NNN represents a number between `0' and `127',
  254. written with no leading zeros.  The leading letters may be in either
  255. upper or lower case; for example, `gr13' and `LR7' are both valid
  256. register names.
  257.  
  258.    You may also refer to general-purpose registers by specifying the
  259. register number as the result of an expression (prefixed with `%%' to
  260. flag the expression as a register number):
  261.      %%EXPRESSION
  262.  
  263. --where EXPRESSION must be an absolute expression evaluating to a
  264. number between `0' and `255'.  The range [0, 127] refers to global
  265. registers, and the range [128, 255] to local registers.
  266.  
  267.    In addition, `as' understands the following protected
  268. special-purpose register names for the AMD 29K family:
  269.  
  270.        vab    chd    pc0
  271.        ops    chc    pc1
  272.        cps    rbp    pc2
  273.        cfg    tmc    mmu
  274.        cha    tmr    lru
  275.  
  276.    These unprotected special-purpose register names are also recognized:
  277.        ipc    alu    fpe
  278.        ipa    bp     inte
  279.        ipb    fc     fps
  280.        q      cr     exop
  281.  
  282. 
  283. File: as.info,  Node: AMD29K Floating Point,  Next: AMD29K Directives,  Prev: AMD29K Syntax,  Up: AMD29K-Dependent
  284.  
  285. Floating Point
  286. --------------
  287.  
  288.    The AMD 29K family uses IEEE floating-point numbers.
  289.  
  290. 
  291. File: as.info,  Node: AMD29K Directives,  Next: AMD29K Opcodes,  Prev: AMD29K Floating Point,  Up: AMD29K-Dependent
  292.  
  293. AMD 29K Machine Directives
  294. --------------------------
  295.  
  296. `.block SIZE , FILL'
  297.      This directive emits SIZE bytes, each of value FILL.  Both SIZE
  298.      and FILL are absolute expressions.  If the comma and FILL are
  299.      omitted, FILL is assumed to be zero.
  300.  
  301.      In other versions of the GNU assembler, this directive is called
  302.      `.space'.
  303.  
  304. `.cputype'
  305.      This directive is ignored; it is accepted for compatibility with
  306.      other AMD 29K assemblers.
  307.  
  308. `.file'
  309.      This directive is ignored; it is accepted for compatibility with
  310.      other AMD 29K assemblers.
  311.  
  312.           *Warning:* in other versions of the GNU assembler, `.file' is
  313.           used for the directive called `.app-file' in the AMD 29K
  314.           support.
  315.  
  316. `.line'
  317.      This directive is ignored; it is accepted for compatibility with
  318.      other AMD 29K assemblers.
  319.  
  320. `.sect'
  321.      This directive is ignored; it is accepted for compatibility with
  322.      other AMD 29K assemblers.
  323.  
  324. `.use SECTION NAME'
  325.      Establishes the section and subsection for the following code;
  326.      SECTION NAME may be one of `.text', `.data', `.data1', or `.lit'.
  327.      With one of the first three SECTION NAME options, `.use' is
  328.      equivalent to the machine directive SECTION NAME; the remaining
  329.      case, `.use .lit', is the same as `.data 200'.
  330.  
  331. 
  332. File: as.info,  Node: AMD29K Opcodes,  Prev: AMD29K Directives,  Up: AMD29K-Dependent
  333.  
  334. Opcodes
  335. -------
  336.  
  337.    `as' implements all the standard AMD 29K opcodes.  No additional
  338. pseudo-instructions are needed on this family.
  339.  
  340.    For information on the 29K machine instruction set, see `Am29000
  341. User's Manual', Advanced Micro Devices, Inc.
  342.  
  343. 
  344. File: as.info,  Node: H8/300-Dependent,  Next: H8/500-Dependent,  Prev: AMD29K-Dependent,  Up: Machine Dependencies
  345.  
  346. H8/300 Dependent Features
  347. =========================
  348.  
  349. * Menu:
  350.  
  351. * H8/300 Options::              Options
  352. * H8/300 Syntax::               Syntax
  353. * H8/300 Floating Point::       Floating Point
  354. * H8/300 Directives::           H8/300 Machine Directives
  355. * H8/300 Opcodes::              Opcodes
  356.  
  357. 
  358. File: as.info,  Node: H8/300 Options,  Next: H8/300 Syntax,  Up: H8/300-Dependent
  359.  
  360. Options
  361. -------
  362.  
  363.    `as' has no additional command-line options for the Hitachi H8/300
  364. family.
  365.  
  366. 
  367. File: as.info,  Node: H8/300 Syntax,  Next: H8/300 Floating Point,  Prev: H8/300 Options,  Up: H8/300-Dependent
  368.  
  369. Syntax
  370. ------
  371.  
  372. * Menu:
  373.  
  374. * H8/300-Chars::                Special Characters
  375. * H8/300-Regs::                 Register Names
  376. * H8/300-Addressing::           Addressing Modes
  377.  
  378. 
  379. File: as.info,  Node: H8/300-Chars,  Next: H8/300-Regs,  Up: H8/300 Syntax
  380.  
  381. Special Characters
  382. ..................
  383.  
  384.    `;' is the line comment character.
  385.  
  386.    `$' can be used instead of a newline to separate statements.
  387. Therefore *you may not use `$' in symbol names* on the H8/300.
  388.  
  389. 
  390. File: as.info,  Node: H8/300-Regs,  Next: H8/300-Addressing,  Prev: H8/300-Chars,  Up: H8/300 Syntax
  391.  
  392. Register Names
  393. ..............
  394.  
  395.    You can use predefined symbols of the form `rNh' and `rNl' to refer
  396. to the H8/300 registers as sixteen 8-bit general-purpose registers.  N
  397. is a digit from `0' to `7'); for instance, both `r0h' and `r7l' are
  398. valid register names.
  399.  
  400.    You can also use the eight predefined symbols `rN' to refer to the
  401. H8/300 registers as 16-bit registers (you must use this form for
  402. addressing).
  403.  
  404.    On the H8/300H, you can also use the eight predefined symbols `erN'
  405. (`er0' ... `er7') to refer to the 32-bit general purpose registers.
  406.  
  407.    The two control registers are called `pc' (program counter; a 16-bit
  408. register, except on the H8/300H where it is 24 bits) and `ccr'
  409. (condition code register; an 8-bit register).  `r7' is used as the
  410. stack pointer, and can also be called `sp'.
  411.  
  412. 
  413. File: as.info,  Node: H8/300-Addressing,  Prev: H8/300-Regs,  Up: H8/300 Syntax
  414.  
  415. Addressing Modes
  416. ................
  417.  
  418.    as understands the following addressing modes for the H8/300:
  419. `rN'
  420.      Register direct
  421.  
  422. `@rN'
  423.      Register indirect
  424.  
  425. `@(D, rN)'
  426. `@(D:16, rN)'
  427. `@(D:24, rN)'
  428.      Register indirect: 16-bit or 24-bit displacement D from register
  429.      N.  (24-bit displacements are only meaningful on the H8/300H.)
  430.  
  431. `@rN+'
  432.      Register indirect with post-increment
  433.  
  434. `@-rN'
  435.      Register indirect with pre-decrement
  436.  
  437. ``@'AA'
  438. ``@'AA:8'
  439. ``@'AA:16'
  440. ``@'AA:24'
  441.      Absolute address `aa'.  (The address size `:24' only makes sense
  442.      on the H8/300H.)
  443.  
  444. `#XX'
  445. `#XX:8'
  446. `#XX:16'
  447. `#XX:32'
  448.      Immediate data XX.  You may specify the `:8', `:16', or `:32' for
  449.      clarity, if you wish; but `as' neither requires this nor uses
  450.      it--the data size required is taken from context.
  451.  
  452. ``@'`@'AA'
  453. ``@'`@'AA:8'
  454.      Memory indirect.  You may specify the `:8' for clarity, if you
  455.      wish; but `as' neither requires this nor uses it.
  456.  
  457. 
  458. File: as.info,  Node: H8/300 Floating Point,  Next: H8/300 Directives,  Prev: H8/300 Syntax,  Up: H8/300-Dependent
  459.  
  460. Floating Point
  461. --------------
  462.  
  463.    The H8/300 family has no hardware floating point, but the `.float'
  464. directive generates IEEE floating-point numbers for compatibility with
  465. other development tools.
  466.  
  467. 
  468. File: as.info,  Node: H8/300 Directives,  Next: H8/300 Opcodes,  Prev: H8/300 Floating Point,  Up: H8/300-Dependent
  469.  
  470. H8/300 Machine Directives
  471. -------------------------
  472.  
  473.    `as' has only one machine-dependent directive for the H8/300:
  474.  
  475. `.h8300h'
  476.      Recognize and emit additional instructions for the H8/300H
  477.      variant, and also make `.int' emit 32-bit numbers rather than the
  478.      usual (16-bit) for the H8/300 family.
  479.  
  480.    On the H8/300 family (including the H8/300H) `.word' directives
  481. generate 16-bit numbers.
  482.  
  483. 
  484. File: as.info,  Node: H8/300 Opcodes,  Prev: H8/300 Directives,  Up: H8/300-Dependent
  485.  
  486. Opcodes
  487. -------
  488.  
  489.    For detailed information on the H8/300 machine instruction set, see
  490. `H8/300 Series Programming Manual' (Hitachi ADE-602-025).  For
  491. information specific to the H8/300H, see `H8/300H Series Programming
  492. Manual' (Hitachi).
  493.  
  494.    `as' implements all the standard H8/300 opcodes.  No additional
  495. pseudo-instructions are needed on this family.
  496.  
  497.    The following table summarizes the H8/300 opcodes, and their
  498. arguments.  Entries marked `*' are opcodes used only on the H8/300H.
  499.  
  500.               Legend:
  501.                  Rs   source register
  502.                  Rd   destination register
  503.                  abs  absolute address
  504.                  imm  immediate data
  505.               disp:N  N-bit displacement from a register
  506.              pcrel:N  N-bit displacement relative to program counter
  507.      
  508.         add.b #imm,rd              *  andc #imm,ccr
  509.         add.b rs,rd                   band #imm,rd
  510.         add.w rs,rd                   band #imm,@rd
  511.      *  add.w #imm,rd                 band #imm,@abs:8
  512.      *  add.l rs,rd                   bra  pcrel:8
  513.      *  add.l #imm,rd              *  bra  pcrel:16
  514.         adds #imm,rd                  bt   pcrel:8
  515.         addx #imm,rd               *  bt   pcrel:16
  516.         addx rs,rd                    brn  pcrel:8
  517.         and.b #imm,rd              *  brn  pcrel:16
  518.         and.b rs,rd                   bf   pcrel:8
  519.      *  and.w rs,rd                *  bf   pcrel:16
  520.      *  and.w #imm,rd                 bhi  pcrel:8
  521.      *  and.l #imm,rd              *  bhi  pcrel:16
  522.      *  and.l rs,rd                   bls  pcrel:8
  523.      
  524.      *  bls  pcrel:16                 bld  #imm,rd
  525.         bcc  pcrel:8                  bld  #imm,@rd
  526.      *  bcc  pcrel:16                 bld  #imm,@abs:8
  527.         bhs  pcrel:8                  bnot #imm,rd
  528.      *  bhs  pcrel:16                 bnot #imm,@rd
  529.         bcs  pcrel:8                  bnot #imm,@abs:8
  530.      *  bcs  pcrel:16                 bnot rs,rd
  531.         blo  pcrel:8                  bnot rs,@rd
  532.      *  blo  pcrel:16                 bnot rs,@abs:8
  533.         bne  pcrel:8                  bor  #imm,rd
  534.      *  bne  pcrel:16                 bor  #imm,@rd
  535.         beq  pcrel:8                  bor  #imm,@abs:8
  536.      *  beq  pcrel:16                 bset #imm,rd
  537.         bvc  pcrel:8                  bset #imm,@rd
  538.      *  bvc  pcrel:16                 bset #imm,@abs:8
  539.         bvs  pcrel:8                  bset rs,rd
  540.      *  bvs  pcrel:16                 bset rs,@rd
  541.         bpl  pcrel:8                  bset rs,@abs:8
  542.      *  bpl  pcrel:16                 bsr  pcrel:8
  543.         bmi  pcrel:8                  bsr  pcrel:16
  544.      *  bmi  pcrel:16                 bst  #imm,rd
  545.         bge  pcrel:8                  bst  #imm,@rd
  546.      *  bge  pcrel:16                 bst  #imm,@abs:8
  547.         blt  pcrel:8                  btst #imm,rd
  548.      *  blt  pcrel:16                 btst #imm,@rd
  549.         bgt  pcrel:8                  btst #imm,@abs:8
  550.      *  bgt  pcrel:16                 btst rs,rd
  551.         ble  pcrel:8                  btst rs,@rd
  552.      *  ble  pcrel:16                 btst rs,@abs:8
  553.         bclr #imm,rd                  bxor #imm,rd
  554.         bclr #imm,@rd                 bxor #imm,@rd
  555.         bclr #imm,@abs:8              bxor #imm,@abs:8
  556.         bclr rs,rd                    cmp.b #imm,rd
  557.         bclr rs,@rd                   cmp.b rs,rd
  558.         bclr rs,@abs:8                cmp.w rs,rd
  559.         biand #imm,rd                 cmp.w rs,rd
  560.         biand #imm,@rd             *  cmp.w #imm,rd
  561.         biand #imm,@abs:8          *  cmp.l #imm,rd
  562.         bild #imm,rd               *  cmp.l rs,rd
  563.         bild #imm,@rd                 daa  rs
  564.         bild #imm,@abs:8              das  rs
  565.         bior #imm,rd                  dec.b rs
  566.         bior #imm,@rd              *  dec.w #imm,rd
  567.         bior #imm,@abs:8           *  dec.l #imm,rd
  568.         bist #imm,rd                  divxu.b rs,rd
  569.         bist #imm,@rd              *  divxu.w rs,rd
  570.         bist #imm,@abs:8           *  divxs.b rs,rd
  571.         bixor #imm,rd              *  divxs.w rs,rd
  572.         bixor #imm,@rd                eepmov
  573.         bixor #imm,@abs:8          *  eepmovw
  574.      
  575.      *  exts.w rd                     mov.w rs,@abs:16
  576.      *  exts.l rd                  *  mov.l #imm,rd
  577.      *  extu.w rd                  *  mov.l rs,rd
  578.      *  extu.l rd                  *  mov.l @rs,rd
  579.         inc  rs                    *  mov.l @(disp:16,rs),rd
  580.      *  inc.w #imm,rd              *  mov.l @(disp:24,rs),rd
  581.      *  inc.l #imm,rd              *  mov.l @rs+,rd
  582.         jmp  @rs                   *  mov.l @abs:16,rd
  583.         jmp  abs                   *  mov.l @abs:24,rd
  584.         jmp  @@abs:8               *  mov.l rs,@rd
  585.         jsr  @rs                   *  mov.l rs,@(disp:16,rd)
  586.         jsr  abs                   *  mov.l rs,@(disp:24,rd)
  587.         jsr  @@abs:8               *  mov.l rs,@-rd
  588.         ldc  #imm,ccr              *  mov.l rs,@abs:16
  589.         ldc  rs,ccr                *  mov.l rs,@abs:24
  590.      *  ldc  @abs:16,ccr              movfpe @abs:16,rd
  591.      *  ldc  @abs:24,ccr              movtpe rs,@abs:16
  592.      *  ldc  @(disp:16,rs),ccr        mulxu.b rs,rd
  593.      *  ldc  @(disp:24,rs),ccr     *  mulxu.w rs,rd
  594.      *  ldc  @rs+,ccr              *  mulxs.b rs,rd
  595.      *  ldc  @rs,ccr               *  mulxs.w rs,rd
  596.      *  mov.b @(disp:24,rs),rd        neg.b rs
  597.      *  mov.b rs,@(disp:24,rd)     *  neg.w rs
  598.         mov.b @abs:16,rd           *  neg.l rs
  599.         mov.b rs,rd                   nop
  600.         mov.b @abs:8,rd               not.b rs
  601.         mov.b rs,@abs:8            *  not.w rs
  602.         mov.b rs,rd                *  not.l rs
  603.         mov.b #imm,rd                 or.b #imm,rd
  604.         mov.b @rs,rd                  or.b rs,rd
  605.         mov.b @(disp:16,rs),rd     *  or.w #imm,rd
  606.         mov.b @rs+,rd              *  or.w rs,rd
  607.         mov.b @abs:8,rd            *  or.l #imm,rd
  608.         mov.b rs,@rd               *  or.l rs,rd
  609.         mov.b rs,@(disp:16,rd)        orc  #imm,ccr
  610.         mov.b rs,@-rd                 pop.w rs
  611.         mov.b rs,@abs:8            *  pop.l rs
  612.         mov.w rs,@rd                  push.w rs
  613.      *  mov.w @(disp:24,rs),rd     *  push.l rs
  614.      *  mov.w rs,@(disp:24,rd)        rotl.b rs
  615.      *  mov.w @abs:24,rd           *  rotl.w rs
  616.      *  mov.w rs,@abs:24           *  rotl.l rs
  617.         mov.w rs,rd                   rotr.b rs
  618.         mov.w #imm,rd              *  rotr.w rs
  619.         mov.w @rs,rd               *  rotr.l rs
  620.         mov.w @(disp:16,rs),rd        rotxl.b rs
  621.         mov.w @rs+,rd              *  rotxl.w rs
  622.         mov.w @abs:16,rd           *  rotxl.l rs
  623.         mov.w rs,@(disp:16,rd)        rotxr.b rs
  624.         mov.w rs,@-rd              *  rotxr.w rs
  625.      
  626.      *  rotxr.l rs                 *  stc  ccr,@(disp:24,rd)
  627.         bpt                        *  stc  ccr,@-rd
  628.         rte                        *  stc  ccr,@abs:16
  629.         rts                        *  stc  ccr,@abs:24
  630.         shal.b rs                     sub.b rs,rd
  631.      *  shal.w rs                     sub.w rs,rd
  632.      *  shal.l rs                  *  sub.w #imm,rd
  633.         shar.b rs                  *  sub.l rs,rd
  634.      *  shar.w rs                  *  sub.l #imm,rd
  635.      *  shar.l rs                     subs #imm,rd
  636.         shll.b rs                     subx #imm,rd
  637.      *  shll.w rs                     subx rs,rd
  638.      *  shll.l rs                  *  trapa #imm
  639.         shlr.b rs                     xor  #imm,rd
  640.      *  shlr.w rs                     xor  rs,rd
  641.      *  shlr.l rs                  *  xor.w #imm,rd
  642.         sleep                      *  xor.w rs,rd
  643.         stc  ccr,rd                *  xor.l #imm,rd
  644.      *  stc  ccr,@rs               *  xor.l rs,rd
  645.      *  stc  ccr,@(disp:16,rd)        xorc #imm,ccr
  646.  
  647.    Four H8/300 instructions (`add', `cmp', `mov', `sub') are defined
  648. with variants using the suffixes `.b', `.w', and `.l' to specify the
  649. size of a memory operand.  `as' supports these suffixes, but does not
  650. require them; since one of the operands is always a register, `as' can
  651. deduce the correct size.
  652.  
  653.    For example, since `r0' refers to a 16-bit register,
  654.      mov    r0,@foo
  655. is equivalent to
  656.      mov.w  r0,@foo
  657.  
  658.    If you use the size suffixes, `as' issues a warning when the suffix
  659. and the register size do not match.
  660.  
  661. 
  662. File: as.info,  Node: H8/500-Dependent,  Next: HPPA-Dependent,  Prev: H8/300-Dependent,  Up: Machine Dependencies
  663.  
  664. H8/500 Dependent Features
  665. =========================
  666.  
  667. * Menu:
  668.  
  669. * H8/500 Options::              Options
  670. * H8/500 Syntax::               Syntax
  671. * H8/500 Floating Point::       Floating Point
  672. * H8/500 Directives::           H8/500 Machine Directives
  673. * H8/500 Opcodes::              Opcodes
  674.  
  675. 
  676. File: as.info,  Node: H8/500 Options,  Next: H8/500 Syntax,  Up: H8/500-Dependent
  677.  
  678. Options
  679. -------
  680.  
  681.    `as' has no additional command-line options for the Hitachi H8/500
  682. family.
  683.  
  684. 
  685. File: as.info,  Node: H8/500 Syntax,  Next: H8/500 Floating Point,  Prev: H8/500 Options,  Up: H8/500-Dependent
  686.  
  687. Syntax
  688. ------
  689.  
  690. * Menu:
  691.  
  692. * H8/500-Chars::                Special Characters
  693. * H8/500-Regs::                 Register Names
  694. * H8/500-Addressing::           Addressing Modes
  695.  
  696. 
  697. File: as.info,  Node: H8/500-Chars,  Next: H8/500-Regs,  Up: H8/500 Syntax
  698.  
  699. Special Characters
  700. ..................
  701.  
  702.    `!' is the line comment character.
  703.  
  704.    `;' can be used instead of a newline to separate statements.
  705.  
  706.    Since `$' has no special meaning, you may use it in symbol names.
  707.  
  708. 
  709. File: as.info,  Node: H8/500-Regs,  Next: H8/500-Addressing,  Prev: H8/500-Chars,  Up: H8/500 Syntax
  710.  
  711. Register Names
  712. ..............
  713.  
  714.    You can use the predefined symbols `r0', `r1', `r2', `r3', `r4',
  715. `r5', `r6', and `r7' to refer to the H8/500 registers.
  716.  
  717.    The H8/500 also has these control registers:
  718.  
  719. `cp'
  720.      code pointer
  721.  
  722. `dp'
  723.      data pointer
  724.  
  725. `bp'
  726.      base pointer
  727.  
  728. `tp'
  729.      stack top pointer
  730.  
  731. `ep'
  732.      extra pointer
  733.  
  734. `sr'
  735.      status register
  736.  
  737. `ccr'
  738.      condition code register
  739.  
  740.    All registers are 16 bits long.  To represent 32 bit numbers, use two
  741. adjacent registers; for distant memory addresses, use one of the segment
  742. pointers (`cp' for the program counter; `dp' for `r0'-`r3'; `ep' for
  743. `r4' and `r5'; and `tp' for `r6' and `r7'.
  744.  
  745. 
  746. File: as.info,  Node: H8/500-Addressing,  Prev: H8/500-Regs,  Up: H8/500 Syntax
  747.  
  748. Addressing Modes
  749. ................
  750.  
  751.    as understands the following addressing modes for the H8/500:
  752. `RN'
  753.      Register direct
  754.  
  755. `@RN'
  756.      Register indirect
  757.  
  758. `@(d:8, RN)'
  759.      Register indirect with 8 bit signed displacement
  760.  
  761. `@(d:16, RN)'
  762.      Register indirect with 16 bit signed displacement
  763.  
  764. `@-RN'
  765.      Register indirect with pre-decrement
  766.  
  767. `@RN+'
  768.      Register indirect with post-increment
  769.  
  770. `@AA:8'
  771.      8 bit absolute address
  772.  
  773. `@AA:16'
  774.      16 bit absolute address
  775.  
  776. `#XX:8'
  777.      8 bit immediate
  778.  
  779. `#XX:16'
  780.      16 bit immediate
  781.  
  782. 
  783. File: as.info,  Node: H8/500 Floating Point,  Next: H8/500 Directives,  Prev: H8/500 Syntax,  Up: H8/500-Dependent
  784.  
  785. Floating Point
  786. --------------
  787.  
  788.    The H8/500 family uses IEEE floating-point numbers.
  789.  
  790. 
  791. File: as.info,  Node: H8/500 Directives,  Next: H8/500 Opcodes,  Prev: H8/500 Floating Point,  Up: H8/500-Dependent
  792.  
  793. H8/500 Machine Directives
  794. -------------------------
  795.  
  796.    `as' has no machine-dependent directives for the H8/500.  However,
  797. on this platform the `.int' and `.word' directives generate 16-bit
  798. numbers.
  799.  
  800. 
  801. File: as.info,  Node: H8/500 Opcodes,  Prev: H8/500 Directives,  Up: H8/500-Dependent
  802.  
  803. Opcodes
  804. -------
  805.  
  806.    For detailed information on the H8/500 machine instruction set, see
  807. `H8/500 Series Programming Manual' (Hitachi M21T001).
  808.  
  809.    `as' implements all the standard H8/500 opcodes.  No additional
  810. pseudo-instructions are needed on this family.
  811.  
  812.    The following table summarizes H8/500 opcodes and their operands:
  813.  
  814.      Legend:
  815.      abs8      8-bit absolute address
  816.      abs16     16-bit absolute address
  817.      abs24     24-bit absolute address
  818.      crb       `ccr', `br', `ep', `dp', `tp', `dp'
  819.      disp8     8-bit displacement
  820.      ea        `rn', `@rn', `@(d:8, rn)', `@(d:16, rn)',
  821.                `@-rn', `@rn+', `@aa:8', `@aa:16',
  822.                `#xx:8', `#xx:16'
  823.      ea_mem    `@rn', `@(d:8, rn)', `@(d:16, rn)',
  824.                `@-rn', `@rn+', `@aa:8', `@aa:16'
  825.      ea_noimm  `rn', `@rn', `@(d:8, rn)', `@(d:16, rn)',
  826.                `@-rn', `@rn+', `@aa:8', `@aa:16'
  827.      fp        r6
  828.      imm4      4-bit immediate data
  829.      imm8      8-bit immediate data
  830.      imm16     16-bit immediate data
  831.      pcrel8    8-bit offset from program counter
  832.      pcrel16   16-bit offset from program counter
  833.      qim       `-2', `-1', `1', `2'
  834.      rd        any register
  835.      rs        a register distinct from rd
  836.      rlist     comma-separated list of registers in parentheses;
  837.                register ranges `rd-rs' are allowed
  838.      sp        stack pointer (`r7')
  839.      sr        status register
  840.      sz        size; `.b' or `.w'.  If omitted, default `.w'
  841.      
  842.      ldc[.b] ea,crb                 bcc[.w] pcrel16
  843.      ldc[.w] ea,sr                  bcc[.b] pcrel8
  844.      add[:q] sz qim,ea_noimm        bhs[.w] pcrel16
  845.      add[:g] sz ea,rd               bhs[.b] pcrel8
  846.      adds sz ea,rd                  bcs[.w] pcrel16
  847.      addx sz ea,rd                  bcs[.b] pcrel8
  848.      and sz ea,rd                   blo[.w] pcrel16
  849.      andc[.b] imm8,crb              blo[.b] pcrel8
  850.      andc[.w] imm16,sr              bne[.w] pcrel16
  851.      bpt                            bne[.b] pcrel8
  852.      bra[.w] pcrel16                beq[.w] pcrel16
  853.      bra[.b] pcrel8                 beq[.b] pcrel8
  854.      bt[.w] pcrel16                 bvc[.w] pcrel16
  855.      bt[.b] pcrel8                  bvc[.b] pcrel8
  856.      brn[.w] pcrel16                bvs[.w] pcrel16
  857.      brn[.b] pcrel8                 bvs[.b] pcrel8
  858.      bf[.w] pcrel16                 bpl[.w] pcrel16
  859.      bf[.b] pcrel8                  bpl[.b] pcrel8
  860.      bhi[.w] pcrel16                bmi[.w] pcrel16
  861.      bhi[.b] pcrel8                 bmi[.b] pcrel8
  862.      bls[.w] pcrel16                bge[.w] pcrel16
  863.      bls[.b] pcrel8                 bge[.b] pcrel8
  864.      
  865.      blt[.w] pcrel16                mov[:g][.b] imm8,ea_mem
  866.      blt[.b] pcrel8                 mov[:g][.w] imm16,ea_mem
  867.      bgt[.w] pcrel16                movfpe[.b] ea,rd
  868.      bgt[.b] pcrel8                 movtpe[.b] rs,ea_noimm
  869.      ble[.w] pcrel16                mulxu sz ea,rd
  870.      ble[.b] pcrel8                 neg sz ea
  871.      bclr sz imm4,ea_noimm          nop
  872.      bclr sz rs,ea_noimm            not sz ea
  873.      bnot sz imm4,ea_noimm          or sz ea,rd
  874.      bnot sz rs,ea_noimm            orc[.b] imm8,crb
  875.      bset sz imm4,ea_noimm          orc[.w] imm16,sr
  876.      bset sz rs,ea_noimm            pjmp abs24
  877.      bsr[.b] pcrel8                 pjmp @rd
  878.      bsr[.w] pcrel16                pjsr abs24
  879.      btst sz imm4,ea_noimm          pjsr @rd
  880.      btst sz rs,ea_noimm            prtd imm8
  881.      clr sz ea                      prtd imm16
  882.      cmp[:e][.b] imm8,rd            prts
  883.      cmp[:i][.w] imm16,rd           rotl sz ea
  884.      cmp[:g].b imm8,ea_noimm        rotr sz ea
  885.      cmp[:g][.w] imm16,ea_noimm     rotxl sz ea
  886.      Cmp[:g] sz ea,rd               rotxr sz ea
  887.      dadd rs,rd                     rtd imm8
  888.      divxu sz ea,rd                 rtd imm16
  889.      dsub rs,rd                     rts
  890.      exts[.b] rd                    scb/f rs,pcrel8
  891.      extu[.b] rd                    scb/ne rs,pcrel8
  892.      jmp @rd                        scb/eq rs,pcrel8
  893.      jmp @(imm8,rd)                 shal sz ea
  894.      jmp @(imm16,rd)                shar sz ea
  895.      jmp abs16                      shll sz ea
  896.      jsr @rd                        shlr sz ea
  897.      jsr @(imm8,rd)                 sleep
  898.      jsr @(imm16,rd)                stc[.b] crb,ea_noimm
  899.      jsr abs16                      stc[.w] sr,ea_noimm
  900.      ldm @sp+,(rlist)               stm (rlist),@-sp
  901.      link fp,imm8                   sub sz ea,rd
  902.      link fp,imm16                  subs sz ea,rd
  903.      mov[:e][.b] imm8,rd            subx sz ea,rd
  904.      mov[:i][.w] imm16,rd           swap[.b] rd
  905.      mov[:l][.w] abs8,rd            tas[.b] ea
  906.      mov[:l].b abs8,rd              trapa imm4
  907.      mov[:s][.w] rs,abs8            trap/vs
  908.      mov[:s].b rs,abs8              tst sz ea
  909.      mov[:f][.w] @(disp8,fp),rd     unlk fp
  910.      mov[:f][.w] rs,@(disp8,fp)     xch[.w] rs,rd
  911.      mov[:f].b @(disp8,fp),rd       xor sz ea,rd
  912.      mov[:f].b rs,@(disp8,fp)       xorc.b imm8,crb
  913.      mov[:g] sz rs,ea_mem           xorc.w imm16,sr
  914.      mov[:g] sz ea,rd
  915.  
  916. 
  917. File: as.info,  Node: HPPA-Dependent,  Next: SH-Dependent,  Prev: H8/500-Dependent,  Up: Machine Dependencies
  918.  
  919. HPPA Dependent Features
  920. =======================
  921.  
  922. * Menu:
  923.  
  924. * HPPA Notes::                Notes
  925. * HPPA Options::              Options
  926. * HPPA Syntax::               Syntax
  927. * HPPA Floating Point::       Floating Point
  928. * HPPA Directives::           HPPA Machine Directives
  929. * HPPA Opcodes::              Opcodes
  930.  
  931. 
  932. File: as.info,  Node: HPPA Notes,  Next: HPPA Options,  Up: HPPA-Dependent
  933.  
  934. Notes
  935. -----
  936.  
  937.    As a back end for GNU CC `as' has been throughly tested and should
  938. work extremely well.  We have tested it only minimally on hand written
  939. assembly code and no one has tested it much on the assembly output from
  940. the HP compilers.
  941.  
  942.    The format of the debugging sections has changed since the original
  943. `as' port (version 1.3X) was released; therefore, you must rebuild all
  944. HPPA objects and libraries with the new assembler so that you can debug
  945. the final executable.
  946.  
  947.    The HPPA `as' port generates a small subset of the relocations
  948. available in the SOM and ELF object file formats.  Additional relocation
  949. support will be added as it becomes necessary.
  950.  
  951. 
  952. File: as.info,  Node: HPPA Options,  Next: HPPA Syntax,  Prev: HPPA Notes,  Up: HPPA-Dependent
  953.  
  954. Options
  955. -------
  956.  
  957.    `as' has no machine-dependent command-line options for the HPPA.
  958.  
  959. 
  960. File: as.info,  Node: HPPA Syntax,  Next: HPPA Floating Point,  Prev: HPPA Options,  Up: HPPA-Dependent
  961.  
  962. Syntax
  963. ------
  964.  
  965.    The assembler syntax closely follows the HPPA instruction set
  966. reference manual; assembler directives and general syntax closely
  967. follow the HPPA assembly language reference manual, with a few
  968. noteworthy differences.
  969.  
  970.    First, a colon may immediately follow a label definition.  This is
  971. simply for compatibility with how most assembly language programmers
  972. write code.
  973.  
  974.    Some obscure expression parsing problems may affect hand written
  975. code which uses the `spop' instructions, or code which makes significant
  976. use of the `!' line separator.
  977.  
  978.    `as' is much less forgiving about missing arguments and other
  979. similar oversights than the HP assembler.  `as' notifies you of missing
  980. arguments as syntax errors; this is regarded as a feature, not a bug.
  981.  
  982.    Finally, `as' allows you to use an external symbol without
  983. explicitly importing the symbol.  *Warning:* in the future this will be
  984. an error for HPPA targets.
  985.  
  986.    Special characters for HPPA targets include:
  987.  
  988.    `;' is the line comment character.
  989.  
  990.    `!' can be used instead of a newline to separate statements.
  991.  
  992.    Since `$' has no special meaning, you may use it in symbol names.
  993.  
  994. 
  995. File: as.info,  Node: HPPA Floating Point,  Next: HPPA Directives,  Prev: HPPA Syntax,  Up: HPPA-Dependent
  996.  
  997. Floating Point
  998. --------------
  999.  
  1000.    The HPPA family uses IEEE floating-point numbers.
  1001.  
  1002. 
  1003. File: as.info,  Node: HPPA Directives,  Next: HPPA Opcodes,  Prev: HPPA Floating Point,  Up: HPPA-Dependent
  1004.  
  1005. HPPA Assembler Directives
  1006. -------------------------
  1007.  
  1008.    `as' for the HPPA supports many additional directives for
  1009. compatibility with the native assembler.  This section describes them
  1010. only briefly.  For detailed information on HPPA-specific assembler
  1011. directives, see `HP9000 Series 800 Assembly Language Reference Manual'
  1012. (HP 92432-90001).
  1013.  
  1014.    `as' does *not* support the following assembler directives described
  1015. in the HP manual:
  1016.  
  1017.      .endm           .liston
  1018.      .enter          .locct
  1019.      .leave          .macro
  1020.      .listoff
  1021.  
  1022.    Beyond those implemented for compatibility, `as' supports one
  1023. additional assembler directive for the HPPA: `.param'.  It conveys
  1024. register argument locations for static functions.  Its syntax closely
  1025. follows the `.export' directive.
  1026.  
  1027.    These are the additional directives in `as' for the HPPA:
  1028.  
  1029. `.block N'
  1030. `.blockz N'
  1031.      Reserve N bytes of storage, and initialize them to zero.
  1032.  
  1033. `.call'
  1034.      Mark the beginning of a procedure call.  Only the special case
  1035.      with *no arguments* is allowed.
  1036.  
  1037. `.callinfo [ PARAM=VALUE, ... ]  [ FLAG, ... ]'
  1038.      Specify a number of parameters and flags that define the
  1039.      environment for a procedure.
  1040.  
  1041.      PARAM may be any of `frame' (frame size), `entry_gr' (end of
  1042.      general register range), `entry_fr' (end of float register range),
  1043.      `entry_sr' (end of space register range).
  1044.  
  1045.      The values for FLAG are `calls' or `caller' (proc has
  1046.      subroutines), `no_calls' (proc does not call subroutines),
  1047.      `save_rp' (preserve return pointer), `save_sp' (proc preserves
  1048.      stack pointer), `no_unwind' (do not unwind this proc), `hpux_int'
  1049.      (proc is interrupt routine).
  1050.  
  1051. `.code'
  1052.      Assemble into the standard section called `$TEXT$', subsection
  1053.      `$CODE$'.
  1054.  
  1055. `.copyright "STRING"'
  1056.      In the SOM object format, insert STRING into the object code,
  1057.      marked as a copyright string.
  1058.  
  1059. `.copyright "STRING"'
  1060.      In the ELF object format, insert STRING into the object code,
  1061.      marked as a version string.
  1062.  
  1063. `.enter'
  1064.      Not yet supported; the assembler rejects programs containing this
  1065.      directive.
  1066.  
  1067. `.entry'
  1068.      Mark the beginning of a procedure.
  1069.  
  1070. `.exit'
  1071.      Mark the end of a procedure.
  1072.  
  1073. `.export NAME [ ,TYP ]  [ ,PARAM=R ]'
  1074.      Make a procedure NAME available to callers.  TYP, if present, must
  1075.      be one of `absolute', `code' (ELF only, not SOM), `data', `entry',
  1076.      `data', `entry', `millicode', `plabel', `pri_prog', or `sec_prog'.
  1077.  
  1078.      PARAM, if present, provides either relocation information for the
  1079.      procedure arguments and result, or a privilege level.  PARAM may be
  1080.      `argwN' (where N ranges from `0' to `3', and indicates one of four
  1081.      one-word arguments); `rtnval' (the procedure's result); or
  1082.      `priv_lev' (privilege level).  For arguments or the result, R
  1083.      specifies how to relocate, and must be one of `no' (not
  1084.      relocatable), `gr' (argument is in general register), `fr' (in
  1085.      floating point register), or `fu' (upper half of float register).
  1086.      For `priv_lev', R is an integer.
  1087.  
  1088. `.half N'
  1089.      Define a two-byte integer constant N; synonym for the portable
  1090.      `as' directive `.short'.
  1091.  
  1092. `.import NAME [ ,TYP ]'
  1093.      Converse of `.export'; make a procedure available to call.  The
  1094.      arguments use the same conventions as the first two arguments for
  1095.      `.export'.
  1096.  
  1097. `.label NAME'
  1098.      Define NAME as a label for the current assembly location.
  1099.  
  1100. `.leave'
  1101.      Not yet supported; the assembler rejects programs containing this
  1102.      directive.
  1103.  
  1104. `.origin LC'
  1105.      Advance location counter to LC. Synonym for the `{No Value For
  1106.      "as"}' portable directive `.org'.
  1107.  
  1108. `.param NAME [ ,TYP ]  [ ,PARAM=R ]'
  1109.      Similar to `.export', but used for static procedures.
  1110.  
  1111. `.proc'
  1112.      Use preceding the first statement of a procedure.
  1113.  
  1114. `.procend'
  1115.      Use following the last statement of a procedure.
  1116.  
  1117. `LABEL .reg EXPR'
  1118.      Synonym for `.equ'; define LABEL with the absolute expression EXPR
  1119.      as its value.
  1120.  
  1121. `.space SECNAME [ ,PARAMS ]'
  1122.      Switch to section SECNAME, creating a new section by that name if
  1123.      necessary.  You may only use PARAMS when creating a new section,
  1124.      not when switching to an existing one.  SECNAME may identify a
  1125.      section by number rather than by name.
  1126.  
  1127.      If specified, the list PARAMS declares attributes of the section,
  1128.      identified by keywords.  The keywords recognized are `spnum=EXP'
  1129.      (identify this section by the number EXP, an absolute expression),
  1130.      `sort=EXP' (order sections according to this sort key when linking;
  1131.      EXP is an absolute expression), `unloadable' (section contains no
  1132.      loadable data), `notdefined' (this section defined elsewhere), and
  1133.      `private' (data in this section not available to other programs).
  1134.  
  1135. `.spnum SECNAM'
  1136.      Allocate four bytes of storage, and initialize them with the
  1137.      section number of the section named SECNAM.  (You can define the
  1138.      section number with the HPPA `.space' directive.)
  1139.  
  1140. `.string "STR"'
  1141.      Copy the characters in the string STR to the object file.  *Note
  1142.      Strings: Strings, for information on escape sequences you can use
  1143.      in `as' strings.
  1144.  
  1145.      *Warning!* The HPPA version of `.string' differs from the usual
  1146.      `as' definition: it does *not* write a zero byte after copying STR.
  1147.  
  1148. `.stringz "STR"'
  1149.      Like `.string', but appends a zero byte after copying STR to object
  1150.      file.
  1151.  
  1152. `.subspa NAME [ ,PARAMS ]'
  1153.      Similar to `.space', but selects a subsection NAME within the
  1154.      current section.  You may only specify PARAMS when you create a
  1155.      subsection (in the first instance of `.subspa' for this NAME).
  1156.  
  1157.      If specified, the list PARAMS declares attributes of the
  1158.      subsection, identified by keywords.  The keywords recognized are
  1159.      `quad=EXPR' ("quadrant" for this subsection), `align=EXPR'
  1160.      (alignment for beginning of this subsection; a power of two),
  1161.      `access=EXPR' (value for "access rights" field), `sort=EXPR'
  1162.      (sorting order for this subspace in link), `code_only' (subsection
  1163.      contains only code), `unloadable' (subsection cannot be loaded
  1164.      into memory), `common' (subsection is common block), `dup_comm'
  1165.      (initialized data may have duplicate names), or `zero' (subsection
  1166.      is all zeros, do not write in object file).
  1167.  
  1168. `.version "STR"'
  1169.      Write STR as version identifier in object code.
  1170.  
  1171. 
  1172. File: as.info,  Node: HPPA Opcodes,  Prev: HPPA Directives,  Up: HPPA-Dependent
  1173.  
  1174. Opcodes
  1175. -------
  1176.  
  1177.    For detailed information on the HPPA machine instruction set, see
  1178. `PA-RISC Architecture and Instruction Set Reference Manual' (HP
  1179. 09740-90039).
  1180.  
  1181. 
  1182. File: as.info,  Node: SH-Dependent,  Next: i960-Dependent,  Prev: HPPA-Dependent,  Up: Machine Dependencies
  1183.  
  1184. Hitachi SH Dependent Features
  1185. =============================
  1186.  
  1187. * Menu:
  1188.  
  1189. * SH Options::              Options
  1190. * SH Syntax::               Syntax
  1191. * SH Floating Point::       Floating Point
  1192. * SH Directives::           SH Machine Directives
  1193. * SH Opcodes::              Opcodes
  1194.  
  1195. 
  1196. File: as.info,  Node: SH Options,  Next: SH Syntax,  Up: SH-Dependent
  1197.  
  1198. Options
  1199. -------
  1200.  
  1201.    `as' has no additional command-line options for the Hitachi SH
  1202. family.
  1203.  
  1204. 
  1205. File: as.info,  Node: SH Syntax,  Next: SH Floating Point,  Prev: SH Options,  Up: SH-Dependent
  1206.  
  1207. Syntax
  1208. ------
  1209.  
  1210. * Menu:
  1211.  
  1212. * SH-Chars::                Special Characters
  1213. * SH-Regs::                 Register Names
  1214. * SH-Addressing::           Addressing Modes
  1215.  
  1216. 
  1217. File: as.info,  Node: SH-Chars,  Next: SH-Regs,  Up: SH Syntax
  1218.  
  1219. Special Characters
  1220. ..................
  1221.  
  1222.    `!' is the line comment character.
  1223.  
  1224.    You can use `;' instead of a newline to separate statements.
  1225.  
  1226.    Since `$' has no special meaning, you may use it in symbol names.
  1227.  
  1228. 
  1229. File: as.info,  Node: SH-Regs,  Next: SH-Addressing,  Prev: SH-Chars,  Up: SH Syntax
  1230.  
  1231. Register Names
  1232. ..............
  1233.  
  1234.    You can use the predefined symbols `r0', `r1', `r2', `r3', `r4',
  1235. `r5', `r6', `r7', `r8', `r9', `r10', `r11', `r12', `r13', `r14', and
  1236. `r15' to refer to the SH registers.
  1237.  
  1238.    The SH also has these control registers:
  1239.  
  1240. `pr'
  1241.      procedure register (holds return address)
  1242.  
  1243. `pc'
  1244.      program counter
  1245.  
  1246. `mach'
  1247. `macl'
  1248.      high and low multiply accumulator registers
  1249.  
  1250. `sr'
  1251.      status register
  1252.  
  1253. `gbr'
  1254.      global base register
  1255.  
  1256. `vbr'
  1257.      vector base register (for interrupt vectors)
  1258.  
  1259. 
  1260. File: as.info,  Node: SH-Addressing,  Prev: SH-Regs,  Up: SH Syntax
  1261.  
  1262. Addressing Modes
  1263. ................
  1264.  
  1265.    `as' understands the following addressing modes for the SH.  `RN' in
  1266. the following refers to any of the numbered registers, but *not* the
  1267. control registers.
  1268.  
  1269. `RN'
  1270.      Register direct
  1271.  
  1272. `@RN'
  1273.      Register indirect
  1274.  
  1275. `@-RN'
  1276.      Register indirect with pre-decrement
  1277.  
  1278. `@RN+'
  1279.      Register indirect with post-increment
  1280.  
  1281. `@(DISP, RN)'
  1282.      Register indirect with displacement
  1283.  
  1284. `@(R0, RN)'
  1285.      Register indexed
  1286.  
  1287. `@(DISP, GBR)'
  1288.      `GBR' offset
  1289.  
  1290. `@(R0, GBR)'
  1291.      GBR indexed
  1292.  
  1293. `ADDR'
  1294. `@(DISP, PC)'
  1295.      PC relative address (for branch or for addressing memory).  The
  1296.      `as' implementation allows you to use the simpler form ADDR
  1297.      anywhere a PC relative address is called for; the alternate form
  1298.      is supported for compatibility with other assemblers.
  1299.  
  1300. `#IMM'
  1301.      Immediate data
  1302.  
  1303. 
  1304. File: as.info,  Node: SH Floating Point,  Next: SH Directives,  Prev: SH Syntax,  Up: SH-Dependent
  1305.  
  1306. Floating Point
  1307. --------------
  1308.  
  1309.    The SH family uses IEEE floating-point numbers.
  1310.  
  1311. 
  1312. File: as.info,  Node: SH Directives,  Next: SH Opcodes,  Prev: SH Floating Point,  Up: SH-Dependent
  1313.  
  1314. SH Machine Directives
  1315. ---------------------
  1316.  
  1317.    `as' has no machine-dependent directives for the SH.
  1318.  
  1319. 
  1320. File: as.info,  Node: SH Opcodes,  Prev: SH Directives,  Up: SH-Dependent
  1321.  
  1322. Opcodes
  1323. -------
  1324.  
  1325.    For detailed information on the SH machine instruction set, see
  1326. `SH-Microcomputer User's Manual' (Hitachi Micro Systems, Inc.).
  1327.  
  1328.    `as' implements all the standard SH opcodes.  No additional
  1329. pseudo-instructions are needed on this family.  Note, however, that
  1330. because `as' supports a simpler form of PC-relative addressing, you may
  1331. simply write (for example)
  1332.  
  1333.      mov.l  bar,r0
  1334.  
  1335. where other assemblers might require an explicit displacement to `bar'
  1336. from the program counter:
  1337.  
  1338.      mov.l  @(DISP, PC)
  1339.  
  1340.    Here is a summary of SH opcodes:
  1341.  
  1342.      Legend:
  1343.      Rn        a numbered register
  1344.      Rm        another numbered register
  1345.      #imm      immediate data
  1346.      disp      displacement
  1347.      disp8     8-bit displacement
  1348.      disp12    12-bit displacement
  1349.      
  1350.      add #imm,Rn                    lds.l @Rn+,PR
  1351.      add Rm,Rn                      mac.w @Rm+,@Rn+
  1352.      addc Rm,Rn                     mov #imm,Rn
  1353.      addv Rm,Rn                     mov Rm,Rn
  1354.      and #imm,R0                    mov.b Rm,@(R0,Rn)
  1355.      and Rm,Rn                      mov.b Rm,@-Rn
  1356.      and.b #imm,@(R0,GBR)           mov.b Rm,@Rn
  1357.      bf disp8                       mov.b @(disp,Rm),R0
  1358.      bra disp12                     mov.b @(disp,GBR),R0
  1359.      bsr disp12                     mov.b @(R0,Rm),Rn
  1360.      bt disp8                       mov.b @Rm+,Rn
  1361.      clrmac                         mov.b @Rm,Rn
  1362.      clrt                           mov.b R0,@(disp,Rm)
  1363.      cmp/eq #imm,R0                 mov.b R0,@(disp,GBR)
  1364.      cmp/eq Rm,Rn                   mov.l Rm,@(disp,Rn)
  1365.      cmp/ge Rm,Rn                   mov.l Rm,@(R0,Rn)
  1366.      cmp/gt Rm,Rn                   mov.l Rm,@-Rn
  1367.      cmp/hi Rm,Rn                   mov.l Rm,@Rn
  1368.      cmp/hs Rm,Rn                   mov.l @(disp,Rn),Rm
  1369.      cmp/pl Rn                      mov.l @(disp,GBR),R0
  1370.      cmp/pz Rn                      mov.l @(disp,PC),Rn
  1371.      cmp/str Rm,Rn                  mov.l @(R0,Rm),Rn
  1372.      div0s Rm,Rn                    mov.l @Rm+,Rn
  1373.      div0u                          mov.l @Rm,Rn
  1374.      div1 Rm,Rn                     mov.l R0,@(disp,GBR)
  1375.      exts.b Rm,Rn                   mov.w Rm,@(R0,Rn)
  1376.      exts.w Rm,Rn                   mov.w Rm,@-Rn
  1377.      extu.b Rm,Rn                   mov.w Rm,@Rn
  1378.      extu.w Rm,Rn                   mov.w @(disp,Rm),R0
  1379.      jmp @Rn                        mov.w @(disp,GBR),R0
  1380.      jsr @Rn                        mov.w @(disp,PC),Rn
  1381.      ldc Rn,GBR                     mov.w @(R0,Rm),Rn
  1382.      ldc Rn,SR                      mov.w @Rm+,Rn
  1383.      ldc Rn,VBR                     mov.w @Rm,Rn
  1384.      ldc.l @Rn+,GBR                 mov.w R0,@(disp,Rm)
  1385.      ldc.l @Rn+,SR                  mov.w R0,@(disp,GBR)
  1386.      ldc.l @Rn+,VBR                 mova @(disp,PC),R0
  1387.      lds Rn,MACH                    movt Rn
  1388.      lds Rn,MACL                    muls Rm,Rn
  1389.      lds Rn,PR                      mulu Rm,Rn
  1390.      lds.l @Rn+,MACH                neg Rm,Rn
  1391.      lds.l @Rn+,MACL                negc Rm,Rn
  1392.      
  1393.      nop                            stc VBR,Rn
  1394.      not Rm,Rn                      stc.l GBR,@-Rn
  1395.      or #imm,R0                     stc.l SR,@-Rn
  1396.      or Rm,Rn                       stc.l VBR,@-Rn
  1397.      or.b #imm,@(R0,GBR)            sts MACH,Rn
  1398.      rotcl Rn                       sts MACL,Rn
  1399.      rotcr Rn                       sts PR,Rn
  1400.      rotl Rn                        sts.l MACH,@-Rn
  1401.      rotr Rn                        sts.l MACL,@-Rn
  1402.      rte                            sts.l PR,@-Rn
  1403.      rts                            sub Rm,Rn
  1404.      sett                           subc Rm,Rn
  1405.      shal Rn                        subv Rm,Rn
  1406.      shar Rn                        swap.b Rm,Rn
  1407.      shll Rn                        swap.w Rm,Rn
  1408.      shll16 Rn                      tas.b @Rn
  1409.      shll2 Rn                       trapa #imm
  1410.      shll8 Rn                       tst #imm,R0
  1411.      shlr Rn                        tst Rm,Rn
  1412.      shlr16 Rn                      tst.b #imm,@(R0,GBR)
  1413.      shlr2 Rn                       xor #imm,R0
  1414.      shlr8 Rn                       xor Rm,Rn
  1415.      sleep                          xor.b #imm,@(R0,GBR)
  1416.      stc GBR,Rn                     xtrct Rm,Rn
  1417.      stc SR,Rn
  1418.  
  1419. 
  1420. File: as.info,  Node: i960-Dependent,  Next: M68K-Dependent,  Prev: SH-Dependent,  Up: Machine Dependencies
  1421.  
  1422. Intel 80960 Dependent Features
  1423. ==============================
  1424.  
  1425. * Menu:
  1426.  
  1427. * Options-i960::                i960 Command-line Options
  1428. * Floating Point-i960::         Floating Point
  1429. * Directives-i960::             i960 Machine Directives
  1430. * Opcodes for i960::            i960 Opcodes
  1431.  
  1432.